package com.qijian.maindata.domain.query;


import com.qijian.common.utils.mybatis.WhereType;
import com.qijian.common.utils.mybatis.WhereTypeEnum;
import lombok.Data;

import java.util.Set;

import lombok.ToString;
import com.baomidou.mybatisplus.annotation.TableName;


/**
 * 质量异常反馈对象 查询条件类
 *
 * @author qijian
 * @date 2023-08-02
 */

@Data
@ToString
@TableName("main_process_order_quality")
public class ProcessOrderQualityQuery {

    @WhereType(filed = "id")
    private Long id;
    @WhereType(filed = "id", type = WhereTypeEnum.IN)
    private Set<Long> ids;
    @WhereType(filed = "work_id")
    private Long workId;
    @WhereType(filed = "quality_code")
    private String qualityCode;
    @WhereType(filed = "request_desc")
    private String requestDesc;
    @WhereType(filed = "status", tableName = "main_process_order_quality")
    private Long status;
    @WhereType(filed = "current_node", type = WhereTypeEnum.LIKE)
    private String currentNode;
    @WhereType(filed = "dept_leader_id")
    private Long deptLeaderId;
    @WhereType(filed = "dept_leader_name")
    private String deptLeaderName;
    @WhereType(filed = "quality_leader_id")
    private Long qualityLeaderId;
    @WhereType(filed = "quality_leader_name")
    private String qualityLeaderName;
    @WhereType(filed = "checker_id")
    private Long checkerId;
    @WhereType(filed = "checker_name")
    private String checkerName;
    @WhereType(filed = "qualified")
    private Boolean qualified;
    @WhereType(filed = "remark")
    private String remark;

    @WhereType(func = "current_id !={1}")
    private Long currentIdNEQ;

    @WhereType(filed = "project_machine_no", type = WhereTypeEnum.LIKE, tableName = "main_project")
    private String projectMachineNo;
    @WhereType(filed = "machine_no", type = WhereTypeEnum.LIKE, tableName = "main_project")
    private String machineNo;
    @WhereType(filed = "process_name", type = WhereTypeEnum.LIKE, tableName = "main_process_order")
    private String processName;
    @WhereType(filed = "work_code", type = WhereTypeEnum.LIKE, tableName = "main_process_order")
    private String workCode;
    @WhereType(filed = "quality_code", type = WhereTypeEnum.LIKE)
    private String qualityCodeLK;


    @WhereType(func = "(current_id ={1} OR create_by_id = {1} )")
    private Long owner;

    @WhereType(func = "main_process_order_quality.current_id= {1}", tableName = "main_process_order_quality")
    private Integer statusGT;

    // 待办
    @WhereType(func = "current_id ={1}")
    private Long dbData;

    // 已办
    @WhereType(func = "((dept_leader_id ={1} and dept_leader_submit_time is not null ) or (quality_leader_id = {1} and quality_leader_submit_time is not null) or (checker_id = {1} and checker_submit_time is not null))")
    private Long ybData;

    // 列表
    @WhereType(func = "(" +
                         "(create_by_id = {1}) or (current_id ={1}) " +
            "or (dept_leader_id ={1} and dept_leader_submit_time is not null ) " +
            "or (quality_leader_id = {1} and quality_leader_submit_time is not null) " +
            "or (checker_id = {1} and checker_submit_time is not null)" +
            ")")
    private Long listData;

    @WhereType(func = "current_id",type = WhereTypeEnum.NOTNULL)
    private Long currentIdNotNull;

    // 获取的数据类型
    @WhereType(ignore = true)
    private String tabName;
}
